﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PhanMemBus;
namespace Pham_mem_hoc_C
{
    public partial class KetQua : Form
    {
        private ThucHanhBus thBus = new ThucHanhBus();
        public KetQua()
        {
            InitializeComponent();
        }
        public KetQua(string tenbai, string danC1, string danC2, string danC3, string danC4, string danC5, string danC6, int diem)
        {
            InitializeComponent();
            lb_tenbai.Text = tenbai;
            tb_dapan1.Text = danC1;
            tb_dapan2.Text = danC2;
            tb_dapan3.Text = danC3;
            tb_dapan4.Text = danC4;
            tb_dapan5.Text = danC5;
            tb_dapan6.Text = danC6;
            tb_diem.Text = diem.ToString();
        }
        //luu lai diem
        private void bt_luu_Click(object sender, EventArgs e)
        {
            string ten = tb_tennguoidung.Text;
            int diem = Convert.ToInt32(tb_diem.Text);
            string tenbai = lb_tenbai.Text;
            thBus.luu_diem(ten, diem, tenbai);
            MessageBox.Show("Bạn đã lưu điểm thành công!");
            this.Close();
        }
        //khong luu diem
        private void bt_huybo_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 }
}
